package cn.bkrc.product.config;

import org.apache.activemq.command.ActiveMQQueue;
import org.apache.activemq.command.ActiveMQTopic;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import javax.jms.Queue;
import javax.jms.Topic;

@Configuration
public class BeanConfig {

    @Bean//交给spring来进行管理
    public Queue queue(){//点对点模式
        return new ActiveMQQueue("myQueue");
    }

    @Bean
    public Topic topic(){//发布/订阅模式
        return new ActiveMQTopic("myTopic");
    }
}
